<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
        <style>
        * {
            margin: 0px;
            padding: 0px;
        }
        body {
            height: 100%;
            margin-left: 50px;
        }
        .container {
        width: 200px;
        height: 200px;
        display: grid;
        justify-content: center;
        align-content: center;
        /* grid-template-columns 属性设置列宽，grid-template-rows 属性设置行高 */
        /* 定义了三列 每一行50px */
        grid-template-columns: 50px 50px 50px;
        /* grid-template-columns: repeat(3,50px); */
        /* 定义了三行 每一行50px */
        grid-template-rows:repeat(3,50px);
        /* grid-template-rows: [first]50px [rowline2 line2]50px [line3]50px [end]; */
        /* 合并写法 */
        grid-gap: 5px 5px;
        }
        .container .item{
            background-color: pink;
            text-align: center;
            line-height: 50px;
        }
        .container .item3 {
        grid-column: auto / span 2;
    }
    .grid-container {
        width: 300px;
        height: 300px;
        display: grid;
        /* grid-template-columns 属性设置列宽，grid-template-rows 属性设置行高 */
        grid-template-columns: auto auto auto;
        grid-template-rows: auto auto;
        grid-gap: 10px;
        background-color: #2196F3;
        padding: 10px;
        grid-template-areas:
            "a a b"
            "a a e"
            "c d e";
        /* grid-auto-flow: row dense; */
    }
    .grid-container>div {
        background-color: rgba(255, 255, 255, 0.8);
        text-align: center;
        padding: 20px 0;
        font-size: 30px;
    }

        .container2 {
            width: 300px;
            height: 200px;
            display: grid;
            grid-template-columns: repeat(3, 50px);
            grid-template-rows: repeat(3,50px);
            grid-gap: 5px;
            background-color: #2196F3;
            padding: 10px;
            justify-content: center;
            align-content: center;
            margin-bottom: 20px;
        } 
        .container2 .item1 {
            grid-column:1 / 3;
            background: #0F85CC;
            text-align: center;
            line-height: 50px;
        }
        .container2 .item2 {
            grid-row: 1 / 3;
            grid-column: 3 / 4;
            background: #1fe605;
            text-align: center;
            line-height: 105px;
        }
        .container2 .item3 {
            grid-row: 2/4;
            grid-column: 1/2;
            background: burlywood;
        }
        .container2 .item4 {
            grid-row: 3/4;
            grid-column: 2/4;
            background: #10caf9;
        }
        .container2 .item5 {
            border-radius: 50%;
            line-height: 50px;
            text-align: center;
            background: #E60537;
        } 

        .grid {
            width: 400px;
            height: 250px;
            margin-top: 30px;
            background: #2196F3;
            display: grid;
            grid-template-columns: 100px 100px 100px;
            grid-template-rows: 60px 60px 60px;
            grid-gap: 20px;
            justify-content: center;
            align-content: center;
            grid-template-areas:
            "a a b"
            "a a e"
            "c d e";
        }
        .grid > div {
            text-align: center;
            background-color: skyblue;
        }

        .flex{
            margin: 30px 0;
            width: 350px;
            height: 320px;
            background-color: #2196F3;
            display: flex;
            padding: 20px;
            text-align: center;
        }
        .flex .son1{
            width: 200px;
        }
        .flex .son1 .item1{
            height: 180px;
            background-color: aqua;
        }
        .flex .son1 .item2{
            margin-top: 20px;
            height: 119px;
            display: flex;
        }
        .flex .son1 .item2 .items1{
            width: 90px;
            background: pink;
        }
        .flex .son1 .item2 .items2{
            width: 90px;
            background: skyblue;
            margin-left: 20px;
        }
        .flex .son2{
            flex: 1;
            margin-left: 20px;
        }
        .flex .son2 .box1{
            height: 92px;
            background: green;
        }
        .flex .son2 .box2{
            height: 207px;
            margin-top: 20px;
            background: #ccc;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        <div class="item">7</div>
        <div class="item">8</div>
        <div class="item">9</div>
    </div>

    <div class="container2">
        <div class="item1">浪</div>
        <div class="item2">漫</div>
        <div class="item3">主</div>
        <div class="item4">义</div>
        <div class="item5">码农</div>
    </div>

    <div class="grid-container">
        <div class="item1" style="grid-area: a;">1</div>
        <div class="item2" style="grid-area: b;">2</div>
        <div class="item3" style="grid-area: c;">3</div>
        <div class="item4" style="grid-area: d;">4</div>
        <div class="item5" style="grid-area: e;">5</div>
    </div>

    <div class="grid">
        <div class="a" style="grid-area: a">1</div>
        <div class="b" style="grid-area: b">2</div>
        <div class="c" style="grid-area: c">3</div>
        <div class="d" style="grid-area: d">4</div>
        <div class="e" style="grid-area: e">5</div>
      </div>

    <div class="flex">
        <div class="son1">
            <div class="item1">1</div>
            <div class="item2">
                <div class="items1">2</div>
                <div class="items2">3</div>
            </div>
        </div>
        <div class="son2">
            <div class="box1">4</div>
            <div class="box2">5</div>
        </div>
    </div>
</body>
</html>